package org.example.factory;

import org.example.strategy.LoginStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Component
public class LoginStrategyFactory {

    @Autowired
    private Map<String, LoginStrategy> loginStrategyMap = new HashMap<>();

    //根据登录类型获取对应的登录策略
    public LoginStrategy getLoginStrategy(String loginType){
        return loginStrategyMap.get(loginType);
    }

}
